<template>
  <el-pagination
    :current-page="currentPage"
    :page-size="pageSize"
    :total="total"
    @current-change="handlePageChange"
    layout="total, prev, pager, next, jumper">
  </el-pagination>
</template>

<script>
export default {
  name: 'Pagination',
  props: {
    total: {
      type: Number,
      required: true,
    },
    currentPage: {
      type: Number,
      required: true,
    },
    pageSize: {
      type: Number,
      required: true,
    },
  },
  methods: {
    handlePageChange(page) {
      // 向父组件传递新的页码
      this.$emit('page-change', page);
    },
  },
};
</script>

<style scoped>
/* 添加样式，如果需要的话 */
</style>
